package com.itcast.donkey.adapters;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by lanouhn on 16/8/29.
 */
public class FragmentsAdapter extends FragmentPagerAdapter{
    private Context context;
    private ArrayList<Fragment> fragments;
    public FragmentsAdapter(FragmentManager fm, Context context,ArrayList<Fragment> fragments) {
        super(fm);
        this.context = context;
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

}
